﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Main : System.Web.UI.MasterPage
{
    UserManagement userManagement;

    public UserManagement CurrentUserManagement
    {
        get { return userManagement; }
    }

    protected void Page_Init(object sender, EventArgs e)
    {
        // create a new instance of UserManagement class
        userManagement = new UserManagement();
        // if user not logged in
        if (!IsPostBack && userManagement.CurrentUser == null)
            Response.Redirect("/Login.aspx");
    }
}
